<h1 id="jQuery"><a href="#jQuery" class="headerlink" title="jQuery"></a>jQuery</h1><blockquote>
<p>jQuery is a fast, small, and feature-rich JavaScript library.</p>
</blockquote>
<p>For information on how to get started and how to use jQuery, please see <a href="https://api.jquery.com/">jQuery’s documentation</a>.<br>For source files and issues, please visit the <a href="https://github.com/jquery/jquery">jQuery repo</a>.</p>
<p>If upgrading, please see the <a href="https://blog.jquery.com/2021/03/02/jquery-3-6-0-released/">blog post for 3.6.0</a>. This includes notable differences from the previous version and a more readable changelog.</p>
<h2 id="Including-jQuery"><a href="#Including-jQuery" class="headerlink" title="Including jQuery"></a>Including jQuery</h2><p>Below are some of the most common ways to include jQuery.</p>
<h3 id="Browser"><a href="#Browser" class="headerlink" title="Browser"></a>Browser</h3><h4 id="Script-tag"><a href="#Script-tag" class="headerlink" title="Script tag"></a>Script tag</h4><pre><code class="html">&lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot;&gt;&lt;/script&gt;
</code></pre>
<h4 id="Babel"><a href="#Babel" class="headerlink" title="Babel"></a>Babel</h4><p><a href="https://babeljs.io/">Babel</a> is a next generation JavaScript compiler. One of the features is the ability to use ES6&#x2F;ES2015 modules now, even though browsers do not yet support this feature natively.</p>
<pre><code class="js">import $ from &quot;jquery&quot;;
</code></pre>
<h4 id="Browserify-x2F-Webpack"><a href="#Browserify-x2F-Webpack" class="headerlink" title="Browserify&#x2F;Webpack"></a>Browserify&#x2F;Webpack</h4><p>There are several ways to use <a href="http://browserify.org/">Browserify</a> and <a href="https://webpack.github.io/">Webpack</a>. For more information on using these tools, please refer to the corresponding project’s documentation. In the script, including jQuery will usually look like this…</p>
<pre><code class="js">var $ = require( &quot;jquery&quot; );
</code></pre>
<h4 id="AMD-Asynchronous-Module-Definition"><a href="#AMD-Asynchronous-Module-Definition" class="headerlink" title="AMD (Asynchronous Module Definition)"></a>AMD (Asynchronous Module Definition)</h4><p>AMD is a module format built for the browser. For more information, we recommend <a href="https://requirejs.org/docs/whyamd.html">require.js’ documentation</a>.</p>
<pre><code class="js">define( [ &quot;jquery&quot; ], function( $ ) {

} );
</code></pre>
<h3 id="Node"><a href="#Node" class="headerlink" title="Node"></a>Node</h3><p>To include jQuery in <a href="https://nodejs.org/">Node</a>, first install with npm.</p>
<pre><code class="sh">npm install jquery
</code></pre>
<p>For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as <a href="https://github.com/jsdom/jsdom">jsdom</a>. This can be useful for testing purposes.</p>
<pre><code class="js">const { JSDOM } = require( &quot;jsdom&quot; );
const { window } = new JSDOM( &quot;&quot; );
const $ = require( &quot;jquery&quot; )( window );
</code></pre>
